<!-- **i18n版本-->
<template>
  <el-dialog :close-on-click-modal="false"
             :visible.sync="showDialog"
             :title="title"
             width="55%">
    <el-form ref="form"
             :model="form"
             size="small"
             label-width="120px">
      <el-row :gutter="10">
        <el-col :xs="24"
                :sm="20"
                :md="12"
                :lg="12"
                :xl="12">
          <!--设备编号 -->
          <el-form-item :label="tf('deviceId')"
                        prop="deviceId">
            <el-input v-model="form.deviceId" />
          </el-form-item>
        </el-col>
        <el-col :xs="24"
                :sm="20"
                :md="12"
                :lg="12"
                :xl="12">
          <!--更新人 -->
          <el-form-item :label="tf('updateBy')">
            <el-input v-model="form.updateBy" />
          </el-form-item>
        </el-col>
        <el-col :xs="24"
                :sm="20"
                :md="12"
                :lg="12"
                :xl="12">
          <!--更新时间 -->
          <el-form-item :label="tf('updateTime')">
            <el-input v-model="form.updateTime" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="10">
        <el-col :xs="24"
                :sm="20"
                :md="12"
                :lg="12"
                :xl="12">
          <!--日志内容 -->
          <el-form-item :label="tf('log')">
            <el-input v-model="form.log"
                      :rows="3"
                      type="textarea" />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>

    <div slot="footer"
         class="dialog-footer">
      <el-button type="primary"
                 @click="close()">{{ $t('btn.close') }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { preview } from '@/api/deviceLogDetail'
import i18nHandler from '@/mixins/i18nHandler'

export default {
  name: 'DeviceLogDetailDetail',
  components: {},
  mixins: [i18nHandler],
  props: {
    module: String,
  },
  data () {
    return {
      showDialog: false,
      title: '',
      form: {},
      i18nQry: {},
    }
  },
  created () {
    this.i18nQry.module = this.module
  },
  methods: {
    close () {
      this.showDialog = false
      this.form = {}
    },

    init () {
      preview({ id: this.form.id, accessKey: this.form.accessKey })
        .then((data) => {
          this.form = data.data
        })
        .catch(() => { })
    },
  },
}
</script>

<style scoped></style>
